import Vue from 'vue'
import Vuex from 'vuex'
import settings from '../settings'

Vue.use(Vuex)

var store = new Vuex.Store({
  state: {
    isLogined: false,
    userInfo: null,
    rootPath: settings.serverUrl
  },
  mutations: {
    logined (state, userInfo) {
      state.isLogined = true
      state.userInfo = userInfo
    },
    unLogined (state) {
      state.isLogined = false
      state.userInfo=  null
    }
  }

})

export default store